#!/usr/bin/env bash

echo "stopping admin-express..."
pkill flask

checkProcess(){
  a=`pgrep -l flask`
  echo ${a:0:1}
  return $?
}

for((i=0;i<60;i++))
  do
    t=$(checkProcess)
    if [[ -n $t ]];
    then
      echo "checking"
      sleep 2s
    else
      echo "stopped!"
      break
    fi
  done
